package com.group9.service.impl;

import com.group9.mapper.ActivityFruitMapper;
import com.group9.pojo.ActivityFruit;
import com.group9.pojo.ActivityFruitExample;
import com.group9.service.ActivityFruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Lcouncillor on 2020/5/14.
 */
@Service
public class ActivityFruitServiceImpl implements ActivityFruitService {

    @Autowired
    ActivityFruitMapper activityFruitMapper;

    @Override
    @Transactional(readOnly = true)
    public List<ActivityFruit> selectByFruitId(Integer fruitId) {
        ActivityFruitExample activityFruitExample = new ActivityFruitExample();
        ActivityFruitExample.Criteria criteria = activityFruitExample.createCriteria();
        criteria.andFruitIdEqualTo(fruitId);
        return activityFruitMapper.selectByExample(activityFruitExample);
    }
}
